package org.socket.api.repo;

import java.util.List;

import org.socket.api.entity.ServerConfig;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

public interface ServerConfigRepo extends PagingAndSortingRepository<ServerConfig, Integer> {

	@Query("select s from ServerConfig s where s.ip = ?1 and s.port = ?2 and s.security = ?3 and s.sname = ?4")
	List<ServerConfig> findByParam(String ip, int port, String security, String sname);

	@Query("select s from ServerConfig s where s.sname = ?1")
	List<ServerConfig> findBySname(String sname, Pageable page);
	
}
